<include file="public/layout"/>
<script type="text/javascript" src="__ROOT__/public/static/js/laydate5.0.9/laydate.js"></script>
<style>
    .freight_template {
        font-size: 14px;
        display: inline-block;
        padding: 0px 10px;
    }
    .category_template {
        font-size: 14px;
        display: inline-block;
        padding: 0px 10px;
    }
</style>
<body style="background-color: #FFF; overflow: auto;">
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page">
    <div class="fixed-bar">
        <div class="item-title"><a class="back" href="javascript:history.back();" title="返回列表"><i
                class="fa fa-arrow-circle-o-left"></i></a>
            <div class="subject">
                <h3>婚礼订单 - 订单详情</h3>
                <h5>添加或编辑订单信息</h5>
            </div>
        </div>
    </div>
    <div class="explanation" id="explanation">
        <div class="title" id="checkZoom"><i class="fa fa-lightbulb-o"></i>
            <h4 title="提示相关设置操作时应注意的要点">操作提示</h4>
            <span id="explanationZoom" title="收起提示"></span>
        </div>
        <ul>
            <li>订单分配后，订单信息尽量不要修改，会影响策划师分配</li>
        </ul>
    </div>
    <form action="{:U('Goods/married_order')}" method="post" class="form-horizontal" id="category_form">
        <div class="ncap-form-default">


            <dl class="row">
                <dt class="tit">
                    <label for="t_woman_name"><em>*</em>合同编号</label>
                </dt>
                <dd class="opt">
                    <input type="text" class="t_mane" name="order" id="t_order"
                           value="{$order_info.order}">
                    <span class="err" style="color:#F00; display:none;" id="err_order"></span>
                    <p class="notic">合同编号不能重复</p>
                </dd>
            </dl>

            <dl class="row">
                <dt class="tit">
                    <label><em>*</em>签单日期</label>
                </dt>
                <dd class="opt">
                    <input type="text" size="30" id="add_order_time" name="order_time" value="{$order_info.order_time}" class="qsbox"  placeholder="签单日期">
                    <span class="err" style="color:#F00; display:none;" id="err_order_time"></span>
                    <p class="notic">签订订单的时间</p>
                </dd>
            </dl>

            <dl class="row">
                <dt class="tit">
                    <label for="t_woman_name"><em>*</em>签单人</label>
                </dt>
                <dd class="opt">
                    <input type="text" class="t_mane" name="order_user" id="t_order_user"
                           value="{$order_info.order_user}">
                    <span class="err" style="color:#F00; display:none;" id="err_order_user"></span>
                    <p class="notic">签单人员</p>
                </dd>
            </dl>

            <dl class="row">
                <dt class="tit" colspan="2">
                    <label class="" for="s_sort">婚礼套餐</label>
                </dt>
                <dd class="opt">
                    <div id="gcategory">
                        <select name="combo" id="parent_id" class="class-select valid">
                            <option value="0">不选择套餐</option>
                            <volist name="moboList" id="vo">
                                <option value="{$vo.id}" <if condition="$vo[id] eq $order_info[combo]"> selected='selected'</if>>{$vo.title}</option>
                            </volist>
                        </select>
                    </div>
                    <p class="notic">套餐信息可以在|基础设置->套餐管理 添加</p>
                </dd>
            </dl>

            <dl class="row">
                <dt class="tit">
                    <label for="t_woman_name"><em>*</em>酒店</label>
                </dt>
                <dd class="opt">
                    <input type="text" class="t_mane" name="hotel" id="t_hotel"
                           value="{$order_info.hotel}">
                    <span class="err" style="color:#F00; display:none;" id="err_hotel"></span>
                    <p class="notic">婚礼的酒店</p>
                </dd>
            </dl>



            <dl class="row">
                <dt class="tit" colspan="2">
                    <label class="" for="s_sort">用户性格</label>
                </dt>
                <dd class="opt">
                    <div>
                        <select name="character_id" id="character_id" class="class-select valid">
                            <option value="0">不选择性格</option>
                            <volist name="characterList" id="vo">
                                <option value="{$vo.id}" <if condition="$vo[id] eq $order_info[combo]"> selected='selected'</if>>{$vo.title}</option>
                            </volist>
                        </select>
                    </div>
                    <p class="notic">套餐信息可以在|基础设置->套餐管理 添加</p>
                </dd>
            </dl>


            <dl class="row">
                <dt class="tit">
                    <label for="t_woman_name"><em>*</em>订单金额</label>
                </dt>
                <dd class="opt">
                    <input type="text" class="t_mane" name="married_money" id="t_married_money"
                           value="{$order_info.married_money}">
                    <span class="err" style="color:#F00; display:none;" id="err_married_money"></span>
                    <p class="notic">金额单位是（元）不能有小数</p>
                </dd>
            </dl>

            <dl class="row">
                <dt class="tit">
                    <label for="t_woman_name"><em>*</em>定金</label>
                </dt>
                <dd class="opt">
                    <input type="text" class="t_mane" name="first_money" id="t_first_money"
                           value="{$order_info.first_money}">
                    <span class="err" style="color:#F00; display:none;" id="err_first_money"></span>
                    <p class="notic">金额单位是（元）不能有小数</p>
                </dd>
            </dl>

            <dl class="row">
                <dt class="tit">
                    <label for="t_woman_name"><em>*</em>新娘姓名</label>
                </dt>
                <dd class="opt">
                    <input type="text" class="t_mane" name="woman_name" id="t_woman_name"
                           value="{$order_info.woman_name}">
                    <span class="err" style="color:#F00; display:none;" id="err_woman_name"></span>
                    <p class="notic">填写真是姓名</p>
                </dd>
            </dl>

            <dl class="row">
                <dt class="tit">
                    <label for="t_sort"><em>*</em>新郎姓名</label>
                </dt>
                <dd class="opt">
                    <input type="text" class="t_mane" name="man_name" id="t_man_name"
                           value="{$order_info.man_name}">
                    <span class="err" style="color:#F00; display:none;" id="err_man_name"></span>
                    <p class="notic">填写真是姓名</p>
                </dd>
            </dl>




            <dl class="row">
                <dt class="tit">
                    <label for="t_mane"><em>*</em>新娘手机号</label>
                </dt>
                <dd class="opt">
                    <input type="text" placeholder="手机号" class="input-txt" name="woman_phone"
                           value="{$order_info.woman_phone}">
                    <span class="err" id="err_woman_phone" style="color:#F00; display:none;"></span>
                    <p class="notic"></p>
                </dd>
            </dl>

            <dl class="row">
                <dt class="tit">
                    <label for="t_mane"><em>*</em>新郎手机号</label>
                </dt>
                <dd class="opt">
                    <input type="text" placeholder="手机号" class="input-txt" name="man_phone"
                           value="{$order_info.man_phone}">
                    <span class="err" id="err_man_phone" style="color:#F00; display:none;"></span>
                    <p class="notic"></p>
                </dd>
            </dl>





            <dl class="row">
                <dt class="tit">
                    <label for="t_sort"><em>*</em>结婚时间</label>
                </dt>
                <dd class="opt">
                    <input type="text" size="30" id="add_time_begin" name="married_date" value="{$order_info.married_date}" class="qsbox"  placeholder="结婚日期">
                    <span class="err" style="color:#F00; display:none;" id="err_married_date"></span>
                    <p class="notic">结婚日期</p>
                </dd>
            </dl>

            <dl class="row">
                <dt class="tit">
                    <label for="t_woman_name"><em>*</em>客户来源</label>
                </dt>
                <dd class="opt">
                    <input type="text" class="t_mane" name="customer_source" id="t_customer_source"
                           value="{$order_info.customer_source}">
                    <span class="err" style="color:#F00; display:none;" id="err_customer_source"></span>
                    <p class="notic">客户来源信息</p>
                </dd>
            </dl>

            <dl class="row">
                <dt class="tit">
                    <label for="t_woman_name"><em>*</em>客户类型</label>
                </dt>
                <dd class="opt">
                    <input type="text" class="t_mane" name="customer_type" id="t_customer_type"
                           value="{$order_info.customer_type}">
                    <span class="err" style="color:#F00; display:none;" id="err_customer_type"></span>
                    <p class="notic">客户类型</p>
                </dd>
            </dl>

            <dl class="row">
                <dt class="tit">
                    <label for="t_woman_name"><em>*</em>所属门店</label>
                </dt>
                <dd class="opt">
                    <input type="text" class="t_mane" name="shop" id="t_shop"
                           value="{$order_info.shop}">
                    <span class="err" style="color:#F00; display:none;" id="err_shop"></span>
                    <p class="notic">门店信息</p>
                </dd>
            </dl>


            <dl class="row goods_shipping">
                <dt class="tit">
                    <label>是否自动分配</label>
                </dt>
                <dd class="opt">
                    <div class="onoff">
                        <label id="is_free_shipping_label_1" for="is_free_shipping1" class="cb-enable <if condition="$order_info[auto] eq 1">selected</if>">是</label>
                        <label id="is_free_shipping_label_0" for="is_free_shipping0" class="cb-disable <if condition="$order_info[auto] eq 0">selected</if>">否</label>
                        <input id="is_free_shipping1" class="is_free_shipping" name="auto" value="1" type="radio" <if condition="$order_info[auto] eq 1"> checked="checked"</if>>
                        <input id="is_free_shipping0" class="is_free_shipping" name="auto" value="0" type="radio" <if condition="$order_info[auto] eq 0"> checked="checked"</if>>
                        <div class="freight_template" style="display:<if condition="$order_info[auto] eq 1">none</if>;">
                            <span>策划师</span>
                            <select name="counselor_id">
                                <option value="0">选择策划师</option>
                                <volist name="userList" id="template">
                                    <option value="{$template.user_id}"<if condition="$template['user_id'] eq $order_info['counselor_id'] ">selected="selected"</if>>{$template.nickname}</option>
                                </volist>
                            </select>
                        </div>



                        <div class="category_template" style="display:<if condition="$order_info[auto] eq 0">none</if>;">
                            <span>策划师分组</span>
                            <select name="cat_id">
                                <option value="0">不选择分组</option>
                                <volist name="usrCatList" id="template">
                                    <option value="{$template.cat_id}"<if condition="$template['cat_id'] eq $order_info['cat_id'] ">selected="selected"</if>>{$template.cat_name}</option>
                                </volist>
                            </select>
                         </div>

                    </div>
                    <p class="notic"></p>
                </dd>
            </dl>

            <dl class="row">
                <dt class="tit">
                    <label for="t_mane"><em>*</em>用户的id</label>
                </dt>
                <dd class="opt">
                    <input type="text" placeholder="用户的id" class="input-txt" name="user_id"
                           value="{$order_info.user_id}">
                    <span class="err" id="err_user_id" style="color:#F00; display:none;"></span>
                    <p class="notic"></p>
                </dd>
            </dl>

            <dl class="row">
                <dt class="tit">
                    <label for="t_woman_name"><em>*</em>渠道备注</label>
                </dt>
                <dd class="opt">
                    <input type="text" class="t_mane" name="channel_remark" id="t_channel_remark"
                           value="{$order_info.channel_remark}">
                    <span class="err" style="color:#F00; display:none;" id="err_channel_remark"></span>
                    <p class="notic">渠道的备注说明</p>
                </dd>
            </dl>


            <dl class="row">
                <dt class="tit">
                    <label for="t_woman_name"><em>*</em>备注信息</label>
                </dt>
                <dd class="opt">
                    <input type="text" class="t_mane" name="remark" id="t_remark"
                           value="{$order_info.remark}">
                    <span class="err" style="color:#F00; display:none;" id="err_remark"></span>
                    <p class="notic">备注说明</p>
                </dd>
            </dl>



            <div class="bot"><a id="submitBtn" class="ncap-btn-big ncap-btn-green" href="JavaScript:void(0);"
                                onClick="ajax_submit_form('category_form','{:U('Married/married_order?is_ajax=1')}');">确认提交</a>
            </div>
        </div>
        <input type="hidden" name="id" value="{$order_info.id}">
    </form>
</div>
<script>

    /** 以下是编辑时默认选中某个商品分类*/
    $(document).ready(function () {
        laydate.render({
            elem: '#add_time_begin'
        });

        laydate.render({
            elem: '#add_order_time'
        });
    });

    // 将品牌滚动条里面的 对应分类移动到 最上面
    //javascript:document.getElementById('category_id_3').scrollIntoView();
    var typeScroll = 0;
    function spec_scroll(o) {
        var id = $(o).val();
        //if(!$('#type_id_'+id).is('dt')){
        //return false;
        //}
        $('#ajax_brandList').scrollTop(-typeScroll);
        var sp_top = $('#type_id_' + id).offset().top; // 标题自身往上的 top
        var div_top = $('#ajax_brandList').offset().top; // div 自身往上的top
        $('#ajax_brandList').scrollTop(sp_top - div_top); // div 移动
        typeScroll = sp_top - div_top;
    }

    function img_call_back(fileurl_tmp) {
        $("#image").val(fileurl_tmp);
        $("#img_a").attr('href', fileurl_tmp);
        $("#img_i").attr('onmouseover', "layer.tips('<img src=" + fileurl_tmp + ">',this,{tips: [1, '#fff']});");
    }

    function initFreight(){
        var is_free_shipping = $("input[name='auto']:checked").val();
        if(is_free_shipping == 0){
            $('.freight_template').show();
            $('.category_template').hide();
        }else{
            $('.freight_template').hide();
            $('.category_template').show();
        }
    }

    $(document).on("click", '.is_free_shipping', function (e) {
        initFreight();
    })

</script>
</body>
</html>